
using System.Drawing;
using System.Windows.Forms;

namespace AntdUI_APPDemo.Controls
{
    public partial class Menu : UserControl
    {
        Form form;
        public Menu(Form _form)
        {
            form = _form;
            InitializeComponent();
            var lang = AntdUI.Localization.CurrentLanguage;
            if (lang.StartsWith("en")) switch2.Width = switch4.Width = 108;
        }

        private void switch1_CheckedChanged(object sender, AntdUI.BoolEventArgs e)
        {
            if (e.Value)
            {
                menu2.ColorScheme = AntdUI.TAMode.Dark;
                if (AntdUI.Config.IsDark) menu2.BackColor = BackColor;
                else menu2.BackColor = Color.FromArgb(0, 21, 41);
            }
            else
            {
                menu2.ColorScheme = AntdUI.TAMode.Light;
                if (AntdUI.Config.IsDark) menu2.BackColor = Color.White;
                else menu2.BackColor = BackColor;
            }
        }
        private void switch2_CheckedChanged(object sender, AntdUI.BoolEventArgs e) { menu2.Collapsed = e.Value; }

        private void switch3_CheckedChanged(object sender, AntdUI.BoolEventArgs e)
        {
            if (e.Value)
            {
                menu3.ColorScheme = AntdUI.TAMode.Dark;
                if (AntdUI.Config.IsDark) menu3.BackColor = BackColor;
                else menu3.BackColor = Color.FromArgb(0, 21, 41);
            }
            else
            {
                menu3.ColorScheme = AntdUI.TAMode.Light;
                if (AntdUI.Config.IsDark) menu3.BackColor = Color.White;
                else menu3.BackColor = BackColor;
            }
        }
        private void switch4_CheckedChanged(object sender, AntdUI.BoolEventArgs e) { menu3.Collapsed = e.Value; }
    }
}